Skip to content

refactor: clean-up code related to feature flags#3901

Open
sgaczol wants to merge 3 commits intomainfrom
@sgaczol/feature-flags-cleanup
Open

refactor: clean-up code related to feature flags#3901
sgaczol wants to merge 3 commits intomainfrom
@sgaczol/feature-flags-cleanup

Conversation

@sgaczol
Copy link
Copy Markdown
Collaborator

@sgaczol sgaczol commented Apr 17, 2026

Description

Following flags: iosPreventReattachmentOfDismissedScreens, iosPreventReattachmentOfDismissedModals, ios26AllowInteractionsDuringTransition had their default values changed to true in prior releases and they are not needed anymore. This PR removes the dead code paths that supported the old false behaviour.

Closes: https://github.com/software-mansion/react-native-screens-labs/issues/1061

Changes

  • remove native code related to mentioned flags
  • make flags do NO-OP on JS side if non-default value

Before & after - visual documentation

N/A

Test plan

Build the app.

Checklist

  • Included code example that can be used to test this change.
  • For visual changes, included screenshots / GIFs / recordings documenting the change.
  • For API changes, updated relevant public types.
  • Ensured that CI passes

@sgaczol sgaczol marked this pull request as ready for review April 17, 2026 13:28
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes legacy feature-flag-controlled code paths for iOS behaviors whose defaults have already been flipped to true, simplifying the JS/native surface area and native implementations.

Changes:

  • Removed the three experimental flags from internal flag storage/accessors and from Fabric native component prop specs.
  • Simplified JS components and native iOS/Android view managers by deleting now-dead plumbing around those flags.
  • Removed iOS interaction-disabling helper implementation that existed only to support the deprecated transition-interaction behavior.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/flags.ts Removes internal storage/accessors for the deprecated flags; keeps API via deprecated getters that always return true.
src/fabric/ScreenStackNativeComponent.ts Removes deprecated iOS-only props from the Fabric codegen spec.
src/fabric/ScreenNativeComponent.ts Removes deprecated iOS-only prop from the Fabric codegen spec.
src/components/ScreenStack.tsx Stops passing deprecated iOS reattachment props into the native component.
src/components/Screen.tsx Removes deprecated transition flag warning and stops passing the deprecated prop to the native component.
ios/helpers/RNSViewInteractionManager.mm Deleted (no longer needed once the flag-controlled behavior is removed).
ios/helpers/RNSViewInteractionManager.h Deleted (no longer needed once the flag-controlled behavior is removed).
ios/helpers/RNSViewInteractionAware.h Deleted (no longer needed once the flag-controlled behavior is removed).
ios/RNSScreenStack.mm Removes flag-driven branching and associated interaction-sinking logic; behavior becomes unconditional.
ios/RNSScreenStack.h Removes public properties for the removed flags.
ios/RNSScreen.mm Removes interaction manager usage tied to the removed transition flag.
ios/RNSScreen.h Removes the interaction manager import and shared-instance API.
android/src/main/java/com/swmansion/rnscreens/ScreenViewManager.kt Removes no-op setter override for the removed iOS-only prop.
android/src/main/java/com/swmansion/rnscreens/ScreenStackViewManager.kt Removes no-op setter overrides for removed iOS-only props.
FabricExample/App.tsx Removes example configuration lines for the removed flags.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ios/RNSScreen.mm
[RNSScreenView.viewInteractionManagerInstance enableInteractionsForLastSubtree];
}

// NOTE(kkafar): We should consider depracating the use of gesture cancel here & align
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in comment: "depracating" should be "deprecating".

Suggested change
// NOTE(kkafar): We should consider depracating the use of gesture cancel here & align
// NOTE(kkafar): We should consider deprecating the use of gesture cancel here & align

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not related to PR

Copy link
Copy Markdown
Member

@kkafar kkafar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

I've got only a single remark regarding comments.

Comment thread src/flags.ts
Comment on lines -250 to -254
* Disables the behavior that blocks interactions during Stack Screen transition.
* The application should immediately react to user gestures, dismissing more screens at once, etc.
* Use only with `iosPreventReattachmentOfDismissedScreens = true` to enable the fix
* for native / JS state desynchronization. On by default.
* PR: https://github.com/software-mansion/react-native-screens/pull/3631
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that descriptions of what did particular flag did should stay in place as long as we don't remove the flag completely.

Copy link
Copy Markdown
Contributor

@t0maboro t0maboro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for @kkafar suggestion, anything else looks good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants